#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "smaterhome.h"
#include "ui_smaterhome.h"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //显示左边选项
    new QListWidgetItem("智能家居", ui->listWidget);
    new QListWidgetItem("音乐播放器", ui->listWidget);

    smaterH=new SmaterHome(ui->textEdit);
    smaterH->hide();
    musicP=new MusicPlayer(ui->textEdit);
    musicP->hide();





}


MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_listWidget_currentRowChanged(int currentRow)
{
    currentFileIndex = currentRow;
    smaterH->hide();
    musicP->hide();
    if (currentRow == 0)
    {

        smaterH->show();
    }
    else if (currentRow == 1)
    {
        musicP->show();
    }

}
